﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;



namespace CoreGallery.Addins.Contracts
{
    /// <summary>
    /// Defines an interface for a storage provider.  Storage providers
    /// serve to encapsulate the manner by which photos, albums, and
    /// galleries are saved.  By calling these methods, the core engine
    /// need not be aware of the source of images (disk, network, web, etc.).
    /// </summary>



    public interface IStorageProviderBase : ICoreAddinBase
    {
        /// <summary>
        /// Returns all galleries that exist for this provider
        /// </summary>s
        IList<CoreGallery.Addins.Contracts.IGallery> Galleries { get; }

        /// <summary>
        /// Whether this gallery can support new photos from the user.
        /// NOTE: A given storage provider may still be an updateable source
        /// through other means, but not by adding photos in CoreGallery.
        /// </summary>
        bool IsReadOnly { get; }

        /// <summary>
        /// Instructs the provider to create a new top-level Gallery.
        /// The provider will prompt the user, as necessary, to collection information
        /// relevant to this creation.
        /// </summary>
        /// <returns>The new Gallery object, or NULL if creation is aborted or unsuccessful.</returns>
        IGallery CreateGallery();

        /// <summary>
        /// Instructs the provider to create a new Album in the given Gallery.
        /// </summary>
        /// <param name="g">Gallery in which to create the new Album</param>
        /// <returns>The new Album, or NULL if creation is aborted or unsuccessful.</returns>
        IAlbum CreateAlbum(CoreGallery.Addins.Contracts.IGallery g);

        /// <summary>
        /// Instructs the provider to create a new photo in the given Album.
        /// </summary>
        /// <param name="a">Album in which to create the new Photo</param>
        /// <returns>The new Photo, or NULL if creation is aborted or unsuccessful.</returns>
        IPhoto CreatePhoto(CoreGallery.Addins.Contracts.IAlbum a);

        /// <summary>
        /// Instructs the provider to create a photo object given the ID
        /// of a photo in the media engine.
        /// </summary>
        /// <param name="id">The GUID of the existing photo</param>
        /// <returns>The new Photo object corresponding to the GUID</returns>
        //IPhoto LoadPhoto(Guid id);

        /// <summary>
        /// Removes this Gallery from the collection.  
        /// </summary>
        /// <param name="g"></param>
        void RemoveGallery(CoreGallery.Addins.Contracts.IGallery g);
    }
}
